﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace ViCode_LeVi.Configs
{
    [DataContract]
    public class TaskItem_Quantity_Image : INotifyPropertyChanged
    {        
        #region Level1
        int _Level1 = 0;
        [DataMember]
        public int Level1
        {
            get
            {
                return _Level1;
            }
            set
            {
                if (value != _Level1)
                {
                    _Level1 = value;
                    if (Level2 < _Level1)
                        Level2 = _Level1 + 1;
                    SendPropertyChanged("Level1");                    
                }
            }
        }
        #endregion

        #region Level2
        int _Level2 = 0;
        [DataMember]
        public int Level2
        {
            get
            {
                return _Level2;
            }
            set
            {
                if (value != _Level2)
                {
                    _Level2 = value;
                    if (Level3 < _Level2)
                        Level3 = _Level2 + 1;
                    SendPropertyChanged("Level2");
                }
            }
        }
        #endregion

        #region Level3
        int _Level3 = 0;
        [DataMember]
        public int Level3
        {
            get
            {
                return _Level3;
            }
            set
            {
                if (value != _Level3)
                {
                    _Level3 = value;                  
                    SendPropertyChanged("Level3");
                }
            }
        }
        #endregion
        #region INotifyPropertyChanged Members
        public void SendPropertyChanged(string sProp)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(sProp));
        }
        public event PropertyChangedEventHandler PropertyChanged;

        #endregion    
    }
}
